#ifndef DECLARATIVEEXTENSION_H
#define DECLARATIVEEXTENSION_H

#include <defs/export.h>
#include <defs/global.h>
#include <extensions/plugin.h>

#include <QtCore>

namespace Optra {
    namespace Extensions{
        class Context;
        class Application;
    }
}

namespace Opl{
    namespace Scripting {
        namespace System {
            namespace IO {
                class File;
            }
        }
    }
}

class DeclarativeEnvironmentEx;
O_PRIVATE_DECLARE(DeclarativeExtension);
class DeclarativeExtension : public Optra::Extensions::Plugin {
    Q_OBJECT
public:


	DeclarativeExtension(Optra::Extensions::Plugin::Type type, Optra::Extensions::Context* ctx, const QFileInfo& info, Opl::Core::EntityObject *parent = 0);
	virtual ~DeclarativeExtension();
	void registerObject(const QString& name, Opl::Core::EntityObject* object, const QString& package = "");
	DeclarativeEnvironmentEx& environment()const;


public slots:
	bool initialize();
	void start();
	void stop();
	void reload();

protected:    
    bool registerClass(Opl::Scripting::System::IO::File* file);        
private:
    O_PRIVATE_DECLARE_MEMBER(DeclarativeExtension)
};

#endif // DECLARATIVEEXTENSION_H

